package com.aqielife.demo.example.lambda;

import java.util.function.Consumer;
import java.util.function.Predicate;

public class FunctionDemo {
    public static void main(String[] args) {
        // IntPredicate
        // 断言函数接口
        Predicate<Integer> predicate = i -> i > 0;
        System.out.println(predicate.test(-9));

        //
        // IntConsumer

        // 消费函数接口, 消费字符串没有返回值
        Consumer<String> consumer = s -> System.out.println(s);
        consumer.accept("输入的数据");
    }
}
